<template>
  <div class="confirm" v-show="show">
    <div class="msg">{{ message }}</div>
    <div class="flex">
      <div class="btn sure" @click="sure">确定</div>
      <div class="btn" @click="$emit('cancel')">取消</div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    show: {
      type: Boolean,
      default: false,
    },
    message: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    sure() {
      this.$emit("sure");
    },
  },
};
</script>
<style lang="less" scoped>
.confirm {
  background-color: #fff;
  position: fixed;
  top: 100px;
  left: 50%;
  max-width: 300px;
  padding: 26px;
  border: 1px solid #ccc;
  border-radius: 10px;
  .flex {
    display: flex;
    padding-top: 20px;
  }
  .btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
  }
  .sure {
    margin-right: 40px;
    background-color: skyblue;
  }
}
</style>